﻿namespace PugLib.Functional
{
    public class Future<T>
    {
        private string _error;
        private bool _hasValue;
        private T _value;

        public string Error
        {
            get { return _error; }
            set { _error = value; }
        }

        public bool HasError
        {
            get { return !string.IsNullOrEmpty(Error); }
        }

        public T Value
        {
            get { return _value; }
            set
            {
                _value = value;
                _hasValue = true;
            }
        }

        public bool HasValue
        {
            get { return _hasValue; }
        }
    }
}